#ifndef HM_PREVIEW_H_
#define HM_PREVIEW_H_

/*
 * William
 * preview container for small images
*/

#include <html\htmlcontrol.h> 
#include "data.h"
class CHtmlControl;

class ChmPreview
{
friend class CMyDataCenter;	
public:
	ChmPreview();
	virtual ~ChmPreview();
	void Init(CHtmlControl* aControl, int aImageNum, int aPageId, int aChannelId);
	bool ProcessTabChange(bool bNextPrev);
	void ClearSnapData();
	void LoadLargeImage(CHtmlElement* item);
	int NextImgToShow();
	void SetSnapImg(int imgindex);
	void DisplayLargeImg(int imgindex);	
	TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType );	
private:
	void LoadLargeImage(int imgindex);
	void ShowTabsChange();
	int iImageNum;
	int iPageId;
	int iLargeImgOrderId; //正在浏览的大图的索引
	
	CHtmlControl* iControl; //just a pointer
	RAppPreviewArray iSnapImgData;	
	int iNextPrev; //表示是向左还是向右
	int iOffset;//start of the first displayed tab
	bool iDownloading;
};

#endif /*HM_PREVIEW_H_*/
